package hiho.ku._1033;

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	
	private static BigInteger[][][] f = new BigInteger[20][10][200];
	private static BigInteger[][] g = new BigInteger[20][200];
	private static BigInteger[][][] b = new BigInteger[20][10][200];
	private static BigInteger[][] c = new BigInteger[20][200];
	
	private static final int DELTA = 100; 
	private static final BigInteger BIGNUM = new BigInteger("1000000007");
	private static final BigInteger[] DIGITS = new BigInteger[10];
	private static final BigInteger[] TENS = new BigInteger[20];
	
	public static void main(String[] args) {
		for (int i = 0; i <= 9; i++)
			DIGITS[i] = BigInteger.valueOf(i);
		TENS[0] = BigInteger.ONE;
		for (int i = 1; i < 20; i++)
			TENS[i] = TENS[i - 1].multiply(BigInteger.TEN);
		
		for (int i = 1; i <= 9; i++) {
			setF(1, i, i, DIGITS[i]);
			setG(1, i, DIGITS[i]);
			setB(1, i, i, BigInteger.ONE);
			setC(1, i, BigInteger.ONE);
		}
		setB(0, 0, 0, BigInteger.ONE);
		setC(0, 0, BigInteger.ONE);
		
		for (int i = 2; i < 20; i++)
			for (int j = 1; j <= 9; j++) {
				int _m = i / 2 * 9;
				for (int k = j - _m; k <= j + _m; k++) {
					int r = j - k;
					BigInteger sumB = BigInteger.ZERO;
					for (int p = i - 1; p >= 0; p--) {
						sumB = sumB.add(getC(p, r));
						r = -r;
					}
					setB(i, j, k, sumB);
					setC(i, k, getC(i, k).add(sumB));
					
					r = j - k;
					BigInteger sumF = sumB.multiply(DIGITS[j]).multiply(TENS[i - 1]).mod(BIGNUM);
					for (int p = i - 1; p >= 1; p--) {
						sumF = sumF.add(getG(p, r));
						r = -r;
					}
					setF(i, j, k, sumF);
					setG(i, k, getG(i, k).add(sumF));
				}
			}
		
		Scanner in = new Scanner(System.in);
		String num1 = in.nextBigInteger().subtract(BigInteger.ONE).toString();
		String num2 = in.next();
		int k = in.nextInt();
		BigInteger count2 = countFor(num2, k);
		if (num1.equals("-1")) {
			System.out.println(count2);
		} else {
			BigInteger count1 = countFor(num1, k);
			System.out.println(count2.subtract(count1).add(BIGNUM).mod(BIGNUM));
		}
	}
	
	private static BigInteger countFor(String s, int k) {
		BigInteger ans = BigInteger.ZERO;
		for (int i = 1; i < s.length(); i++)
			ans = ans.add(getG(i, k));
		return ans.add(countFor(s, k, 0, BigInteger.ZERO)).mod(BIGNUM);
	}
	
	private static BigInteger countFor(String s, int k, int pos, BigInteger pre) {
		if (pos == s.length())
			return pre.multiply(getC(0, k)).mod(BIGNUM);
		
		BigInteger mPre = pre.multiply(TENS[s.length() - pos]);
		int nowDigit = s.charAt(pos) - '0';
		int restLength = s.length() - pos;
		
		BigInteger ans = BigInteger.ZERO;
		for (int i = 1; i < nowDigit; i++)
			ans = ans.add(mPre.multiply(getB(restLength, i, k))).add(getF(restLength, i, k));
		if (pos > 0 && nowDigit > 0) {
			int r = -k;
			for (int i = restLength - 1; i >= 0; i--) {
				ans = ans.add(mPre.multiply(getC(i, r))).add(getG(i, r));
				r = -r;
			}
		}
		ans = ans.add(countFor(s, nowDigit - k, pos + 1, pre.multiply(BigInteger.TEN).add(DIGITS[nowDigit])));
		
		return ans.mod(BIGNUM);
	}
	
	private static BigInteger getF(int i, int j, int k) {
		if (f[i][j][k + DELTA] == null)
			return BigInteger.ZERO;
		return f[i][j][k + DELTA];
	}
	
	private static void setF(int i, int j, int k, BigInteger v) {
		f[i][j][k + DELTA] = v.mod(BIGNUM);
	}
	
	private static BigInteger getG(int i, int j) {
		if (g[i][j + DELTA] == null)
			return BigInteger.ZERO;
		return g[i][j + DELTA];
	}
	
	private static void setG(int i, int j, BigInteger v) {
		g[i][j + DELTA] = v.mod(BIGNUM);
	}
	
	private static BigInteger getB(int i, int j, int k) {
		if (b[i][j][k + DELTA] == null)
			return BigInteger.ZERO;
		return b[i][j][k + DELTA];
	}
	
	private static void setB(int i, int j, int k, BigInteger v) {
		b[i][j][k + DELTA] = v.mod(BIGNUM);
	}
	
	private static BigInteger getC(int i, int j) {
		if (c[i][j + DELTA] == null)
			return BigInteger.ZERO;
		return c[i][j + DELTA];
	}
	
	private static void setC(int i, int j, BigInteger v) {
		c[i][j + DELTA] = v.mod(BIGNUM);
	}

}
